<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>全部员工信息</title>
    <link rel="stylesheet" href="/layui/css/layui.css" media="all">
</head>
<body>
<table id="demo" lay-filter="test"></table>

<script src="/layui/layui.js"></script>
<script>
    layui.use('table', function(){
        var table = layui.table;

        //第一个实例
        table.render({
            elem: '#demo'
            ,toolbar:true
            ,url: '/queryall' //数据接口
            ,cols: [[ //表头
                {field: 'u_id', title: 'ID',  sort: true, fixed: 'left'}
                ,{field: 'u_name', title: '姓名' }
                ,{field: 'u_sex', title: '性别' }
                ,{field: 'u_email', title: '邮箱'}
                ,{field: 'postname', title: '岗位'}
                ,{field: 'u_phone', title: '电话'}
                ,{field: 'departmentname', title: '部门'}
                ,{field: 'u_entrytime', title: '入职时间', sort: true}
                ,{field: 'u_university', title: '毕业院校'}
            ]]
            ,page: {
                limit:5,
                limits:[1, 5, 10, 40, 100],
                layout:['prev', 'page', 'next','count','limit','refresh']
            } //开启分页
        });
    });
</script>
</body>
</html>